/*
 * key.h
 *
 * Created: 8/19/2013 2:49:46 PM
 *  Author: Ken Arok
 *
 *      Revision history:
 *      ---------------------------------------------------------
 *      Date			|	Revised by		|	Description
 *      ---------------------------------------------------------
 *      1. Aug 19, 2013	|	Yosef			| New establishment
 *
 *
 *
 * \brief Middleware Driver of Keypad User Interface.
 *
 * Copyright (c) 2013 PT Hanindo Automation Solutions. All rights reserved.
 *
 */

/*! \page key_drivers Keypad Drivers
  The Drivers Abstraction for Keypad. These module is in the middleware layer.
  \section section_keypad_drivers_api Keypad Drivers API
  <pre>\ref subsection_keypad_enable Enable Keypad.</pre>
  <pre>\ref subsection_keypad_disable Disable Keypad.</pre>
  <pre>\ref subsection_keypad_init Initialize Keypad.</pre>
  <pre>\ref subsection_keypad_getkeyword Get Keyword (16-bit) of Keypad.</pre>
  <pre>\ref subsection_keypad_getkeychar Get Keychar (8-bit) of Keypad.</pre>
  <pre>\ref subsection_keypad_getkeycombine Get Combination (16-bit) of Keypad.</pre>
  <pre>\ref subsection_keypad_waitkeychar Wait Character from Keypad.</pre>
  <pre>\ref subsection_keypad_waitkeyrelease Wait Keypad released.</pre>
*/


#ifndef KEY_H_
#define KEY_H_

#include "key_hal.h"


/** \brief Initialize keypad interface.
 *
 */
extern void vInitKey(void);

/** \brief Get 16 bit representation of pressed key.
 *
 * \return KEYWORD		16 bit key representative of pressed button.
 *
 */
extern uint16_t vGetKeyWord(void);

/** \brief Get character representation of pressed key.
 *
 * \return KEYCHAR		Character of key pressed representation.
 *
 */
extern char vGetKeyChar(void);

/** \brief Get 16 bit representation of pressed combination key.
 *
 * \return KEYCOMBINE	16 bit key representative of pressed button.
 *
 */
extern uint16_t vGetKeyCombine(void);

/** \brief Wait until one of wanted characters of keypad is pressed.
 *
 * \param	_stringWaitKey		Pointer to the string of waited characters.
 *
 * \return Status
 *	\retval 0			Failed
 *	\retval Keychar		Character of pressed key.
 *
 */
extern char vWaitKeyChar(const char *_stringWaitKey);

/** \brief Wait until keypad is released.
 *
 */
extern void vWaitKeyRelease(void);


#endif /* KEY_H_ */
